//
//  MainSwipeLeftCell.m
//  DZPoker
//
//  Created by Echo on 13-12-5.
//  Copyright (c) 2013年 Echo. All rights reserved.
//

#import "MainSwipeLeftCell.h"

@implementation MainSwipeLeftCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
//        UIImageView *bg = [[UIImageView alloc] initWithImage:IMG(@"menu_bg.jpg")];
//        self.backgroundView = bg;
        
        imageview = [[UIImageView alloc] initWithFrame:CGRectMake(20+30, (65-29)/2.0, 29, 29)];
        [self addSubview:imageview];
        
        label = [ComLabel labelWithFont:16 title:@""];
        label.font = [UIFont boldSystemFontOfSize:17];
        label.textColor = [UIColor whiteColor];
        label.frame = RECT(FX(imageview)+FW(imageview) +20, 0, 200, 65);
        [self addSubview:label];
        
        
        unreadCountBtn = [UIButton buttonWithType:0];
        unreadCountBtn.titleEdgeInsets = UIEdgeInsetsMake(.5, 1.5, 0, 0);
        unreadCountBtn.userInteractionEnabled = NO;
        [unreadCountBtn setBackgroundImage:[IMG(@"converstion_icon_iprompt.png") stretchableImageWithLeftCapWidth:50/4 topCapHeight:50/4] forState:UIControlStateNormal];
        [unreadCountBtn setBackgroundImage:[IMG(@"converstion_icon_iprompt.png") stretchableImageWithLeftCapWidth:50/4 topCapHeight:50/4] forState:UIControlStateHighlighted];
        unreadCountBtn.titleLabel.font = [UIFont boldSystemFontOfSize:10];
        [self addSubview:unreadCountBtn];
        
        UIImageView *line = [[UIImageView alloc] initWithImage:IMG(@"menu_line.png")];
        line.frame = RECT(0, 65-2, SCREEN_WIDTH-LEFT_DOCK_WIDTH, 1);
        [self addSubview:line];
    }
    return self;
}

-(void)setIndex:(int)index{
    if (index == 0) {
        imageview.image = IMG(@"home-.png");
        label.text = STR(@"主页");
    }else if (index == 1) {
        imageview.image = IMG(@"S习惯 按钮.png");
        label.text = STR(@"习惯");
    }else if (index == 2) {
        imageview.image = IMG(@"设置-按钮.png");
        label.text = STR(@"设置");
    }
}

@end
